package com.zx.mes.hyl.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zx.mes.hyl.response.ObjectRestResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import com.zx.mes.hyl.controller.BaseController;
import com.zx.mes.hyl.entity.Store;
import com.zx.mes.hyl.service.StoreService;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 华云龙
 * @since 2018-12-05
 */
@RestController
@RequestMapping("/store")
public class StoreController extends BaseController<StoreService, Store> {

    @GetMapping("/getByGoodIdAndSupplierId")
    public ObjectRestResponse<Store> getByGoodIdAndSupplierId(String goodId,String supplierId) {
        ObjectRestResponse.Builder<Store> response = new ObjectRestResponse.Builder<>();
        Store store = this.biz.getOne(new QueryWrapper<Store>()
                .lambda().eq(Store::getGoodsId, goodId).eq(Store::getSupplierId, supplierId));
        response.data(store).message("获取一笔数据成功!").status(200);
        return response.build();
    }

}

